package com.bzzoneit.newsys.utils.kaptcha;

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

import com.google.code.kaptcha.GimpyEngine;
import com.google.code.kaptcha.util.Configurable;

/**
 * kaptcha中验证码样式引擎有WaterRipple（水纹类似的）、ShadowGimpy(投影)、FishEyeGimpy（鱼眼）三种样式，在将图片缩小一些后，有这些样式，就很难辨认了。
 * 增加了一种没有干扰效果的样式
 * @author ruby
 *
 */
public class NoGimpy extends Configurable implements GimpyEngine {

	public BufferedImage getDistortedImage(BufferedImage baseImage) {
		BufferedImage distortedImage = new BufferedImage(baseImage.getWidth(),
				baseImage.getHeight(), BufferedImage.TYPE_INT_ARGB);

		Graphics2D graph = (Graphics2D) distortedImage.getGraphics();
		graph.drawImage(baseImage, 0, 0, null, null);
		graph.dispose();
		return distortedImage;
	}
}